#include <iostream>
#include <vector>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

using namespace std;

int main ()
{
	vector<int> vc;
	vc.push_back(1);
	vc.push_back(2);
	vc.push_back(3);
	vc.push_back(4);
	vector<int>::iterator it = vc.begin();
	
	int m_fd = open("tmpfile", O_RDWR | O_CREAT, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
	
	write( m_fd, (const void*)&(*(it)), 16);
	
	vector<int> vcc(4);
	vector<int>::iterator itt = vcc.begin();
	//lseek64 (m_fd, 0, SEEK_SET);
	lseek (m_fd, 0, SEEK_SET);
	read( m_fd, (void*)&(*(itt)), 16);
	
	cout << vcc[0] << vcc[1] << vcc[2] << vcc[3] << endl;
	return 0;
}
